﻿using System;
using System.Collections.Generic;
using System.Text;
/// <summary>
/// Using implement check data input is valid
/// </summary>
public class RegularExpression
{
    /// <summary>
    /// Limit length string input
    /// </summary>
    /// <param name="input">String value input</param>
    /// <param name="max">Regulations max size of string</param>
    /// <returns>string smaller lengh of string regulations</returns>
    public static string TrimToMaxSize(string input, int max)
    {
        return ((input != null) && (input.Length > max)) ?
            input.Substring(0, max) : input;
    }
}
